package com.baidu.Chapter02;

import java.util.Scanner;

public class ex2_19 {
    public static void main(String[] args) {
        System.out.print("Enter three points for a striangle：");
        Scanner sc=new Scanner(System.in);
        double x1= sc.nextDouble();
        double y1= sc.nextDouble();
        double x2= sc.nextDouble();
        double y2= sc.nextDouble();
        double x3= sc.nextDouble();
        double y3= sc.nextDouble();
        double first = Math.sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
        double second = Math.sqrt((x2-x3)*(x2-x3)+(y2-y3)*(y2-y3));
        double third = Math.sqrt((x3-x1)*(x3-x1)+(y3-y1)*(y3-y1));
        double s=(first+second+third)/2;
        double area=Math.sqrt(s*(s-first)*(s-second)*(s-third));
        System.out.println("The area of the triangle is "+String.format("%.1f",area));

    }
}
